package com.uchengwang.ui.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * Created by U城网 on 2017/6/22.
 * 线程池
 */

public class ExecutorsUtils {
    private static ExecutorsUtils utils;
    private ExecutorsUtils (){}

    public static ExecutorsUtils getUtils() {
        if (utils ==null){
            utils = new ExecutorsUtils();
        }
        return utils;
    }

    /**
     * 创建单一的线程池
     * */
    public ExecutorService createSingleThread(){
        ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();
        return singleThreadExecutor;
    }

}
